package com.hq.door.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hq.door.dao.IUserDao;
import com.hq.door.pojo.UserInfor;
import com.hq.door.service.IUserService;

@Service("userService") //userService即服务在spring容器中的id
public class UserServiceImpl  extends BaseServiceImpl<UserInfor> implements IUserService{

	IUserDao userDao;
	public IUserDao getUserDao() {
		return userDao;
	}
	
	@Autowired    //容器根据属性类型自动注入
	public void setUserDao(IUserDao userDao) {
		this.userDao = userDao;
		this.setBaseDao(userDao);
	}


	@Override
	public void addUser(UserInfor user) {
		System.out.println("---用户添加成功!----");
		userDao.save(user);
	}
}
